package org.example.product.feign.client;

import icu.funkye.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "product-service", name = "product-service",path = "/product")
public interface ProductFeignClient {

    /**
     * 查询商品
     * @param
     * @return
     */
    @GetMapping("/getById")
    Product query(@RequestParam Integer demandCombineId);

    /**
     * 减库存 ALTER USER ‘root’@‘%’ IDENTIFIED BY '123456';
     * @param
     * @return
     */
    @GetMapping("/reduceStock")
    Boolean reduceStock(@RequestParam Integer id,@RequestParam Integer amount);

}
